<?php


namespace app\index\controller;


use think\Controller;
use think\Db;


class ComplaintController extends Controller
{
    public function index(){
        return $this->fetch();
    }
//添加投诉信息
    public function complaint_do()
    {
        //$data=Db::table('sa_complaint')->find();
        $uid = intval($_POST['uid']);
        $address = $this->request->param('address');
        $content = $this->request->param('content');
        $data = [
            'uid'     =>   $uid,
            'address' =>   $address,
            'content' =>   $content,
            'reply'  =>   "未回复",
            'time'   =>   date('Y-m-d H:i:s')
        ];
        Db::table('sa_complaint')->insert($data);
        return $this->success('提交成功');
        //return $address.$content;
    }
   //跳转投诉页面
    public function complaint_reply()
    {
        $data=Db::table('sa_complaint')->select();
        $this->assign('list',$data);
        return $this->fetch('history');
    }
}